package com.aiti.lulian.schedule;

import com.aiti.lulian.service.impl.CardRankService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ClearScoreSchedule {

    @Autowired
    private CardRankService cardRankService;

    @Scheduled(cron = "1 0 0 1 * ?")
    public void clearAllScores() {
        log.info("开始执行每月积分清零任务：" + new java.util.Date());
        cardRankService.clearScore();
    }
}